<template>
  <div class="">
    <ant-search></ant-search>
    <div class="store-info-classiflcation-box" v-if="data" v-for="(item,index) in data" :key="index">
      <div class="store-info-classiflcation-header">
        <span class="title">{{item.cate_title}}</span>
        <span class="tail">全部</span>
      </div>
      <div class="store-info-classiflcation-body">
        <div class="store-info-classiflcation-list">
          <div class="store-info-classiflcation-warp" v-for="(cateItem,cateIndex) in item._child" :key="cateIndex">
            <div class="store-info-classiflcation-item" @click="$router.push({ path: '/pages/storeList/storeList', query: { cate_id: cateItem.id } })">
              {{cateItem.cate_title}}
            </div>
          </div>
        </div>
      </div>
    </div>
    <i-toast id="toast" />
    <i-action-sheet :visible="shopSheetCisible" :actions="shopSheet" show-cancel @cancel="shopSheetCancel" @iclick="shopSheetClick" />
  </div>
</template>

<script>
  import {
    mapState,
    mapMutations
  } from "Vuex";
  // 依赖
  const {
    $Toast
  } = require('@/../static/iview/base/index');
  import AntSearch from '@/components/search'
  import request from "@/api/request";
  import {
    getMallCollect,
    cancelCollect,
    copyClipboard
  } from "@/utils/index";
  export default {
    components: {
      AntSearch,
    },
    data() {
      return {
        data: null,
        page: 1
      };
    },
    computed: {
      ...mapState(['locationInfo'])
    },
    methods: {
      getMallGoodsDetail() {
        // 请求店铺详情
        request
          .getMallStoreCates({
            store_id: this.$route.query.cate_id,
          })
          .then(res => {
            console.log(res.data)
            this.data = res.data.list
          });
      },
    },
    mounted() {
      this.getMallGoodsDetail();
    }
  };

</script>

<style lang="less">
  .store-info-classiflcation-box {
    background: #fff;
    margin-bottom: 10px;
    width: 100%;

    .store-info-classiflcation-header {
      padding: 20px 15px 10px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      position: relative;
      margin-bottom: 10px;
      width: 100%;

      &::after {
        content: '';
        position: absolute;
        display: block;
        left: 15px;
        bottom: 0;
        right: 0;
        background: #F9F9F9;
        height: 1px;
      }

      .title {
        display: block;
        font-size: 14px;
        color: rgba(51, 51, 51, 1);
        line-height: 1em;
        flex: 1;
      }

      .tail {
        display: block;
        font-size: 12px;
        color: rgba(160, 160, 160, 1);
        line-height: 1em;
      }
    }

    .store-info-classiflcation-body {
      padding-bottom: 15px;
    }

    .store-info-classiflcation-list {
      display: flex;
      flex-wrap: wrap;
      padding-left: 5px;
      padding-right: 15px;
    }

    .store-info-classiflcation-warp {
      flex: 0 25%;
      padding-left: 10px;
    }

    .store-info-classiflcation-item {
      height: 32px;
      background: rgba(255, 255, 255, 1);
      border: 1px solid rgba(234, 234, 234, 1);
      border-radius: 5px;
      font-size: 14px;
      color: rgba(51, 51, 51, 1);
      line-height: 32px;
      text-align: center;
      margin-bottom: 10px;
    }
  }

</style>
